package com.nts.visionworks.business.endpoint.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.codehaus.jackson.annotate.JsonIgnore;

/**
 * Building generated by hbm2java
 */
@Entity
@Table(name = "building", catalog = "visionworks")
public class Building implements java.io.Serializable
{

	private Integer buildingId;
	private String buildingName;
	private String description;
	private Date createdDateTime;
	private long creatorId;
	private Date updatedDateTime;
	private Set<BuildingFloor> buildingFloors = new HashSet<BuildingFloor>(0);

	public Building()
	{
	}

	public Building(String buildingName, Date createdDateTime, long creatorId)
	{
		this.buildingName = buildingName;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
	}

	public Building(String buildingName, String description,
			Date createdDateTime, long creatorId, Date updatedDateTime,
			Set<BuildingFloor> buildingFloors)
	{
		this.buildingName = buildingName;
		this.description = description;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
		this.updatedDateTime = updatedDateTime;
		this.buildingFloors = buildingFloors;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "BuildingId", unique = true, nullable = false)
	public Integer getBuildingId()
	{
		return this.buildingId;
	}

	public void setBuildingId(Integer buildingId)
	{
		this.buildingId = buildingId;
	}

	@NotNull(message = "validation.endPoint.building.buildingName.notNull")
	@Size(message = "validation.endPoint.building.buildingName.length", max = 100, min = 1)
	@Column(name = "BuildingName", nullable = false, length = 100)
	public String getBuildingName()
	{
		return this.buildingName;
	}

	public void setBuildingName(String buildingName)
	{
		this.buildingName = buildingName;
	}

	@Size(message = "validation.endPoint.building.description.length", max = 1000)
	@Column(name = "Description", length = 1000)
	public String getDescription()
	{
		return this.description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreatedDateTime", nullable = false, length = 19)
	public Date getCreatedDateTime()
	{
		return this.createdDateTime;
	}

	public void setCreatedDateTime(Date createdDateTime)
	{
		this.createdDateTime = createdDateTime;
	}

	@Column(name = "CreatorId", nullable = false)
	public long getCreatorId()
	{
		return this.creatorId;
	}

	public void setCreatorId(long creatorId)
	{
		this.creatorId = creatorId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UpdatedDateTime", length = 19)
	public Date getUpdatedDateTime()
	{
		return this.updatedDateTime;
	}

	public void setUpdatedDateTime(Date updatedDateTime)
	{
		this.updatedDateTime = updatedDateTime;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "building")
	@OrderBy("floorNumber")
	public Set<BuildingFloor> getBuildingFloors()
	{
		return this.buildingFloors;
	}

	public void setBuildingFloors(Set<BuildingFloor> buildingFloors)
	{
		this.buildingFloors = buildingFloors;
	}

}
